# -*- coding: utf-8 -*-
from datetime import timedelta
from utils.operators.external_dag_sensor import ExternalDagSensor
from airflow.operators.dummy_operator import DummyOperator


jms_ods__project_work_order = ExternalDagSensor(
    task_id='jms_ods__project_work_order',
    external_dag_id='jms_ods_lmdm_day',
    external_task_id='jms_ods__project_work_order',
    external_execution_date_time='{{ execution_date | cst_ds }} 02:50:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)

jms_ods__yl_tmsnew_tms_shipment_stop = ExternalDagSensor(
    task_id='jms_ods__yl_tmsnew_tms_shipment_stop',
    external_dag_id='jms_ods_tms_day',
    external_task_id='jms_ods__yl_tmsnew_tms_shipment_stop',
    external_execution_date_time='{{ execution_date | cst_ds }} 02:50:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)


jms_ods__yl_tmsnew_branch_shipment_stop = ExternalDagSensor(
    task_id='jms_ods__yl_tmsnew_branch_shipment_stop',
    external_dag_id='jms_ods_tms_day',
    external_task_id='jms_ods__yl_tmsnew_branch_shipment_stop',
    external_execution_date_time='{{ execution_date | cst_ds }} 02:50:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)

jms_ods__yl_tmsnew_tms_shipment = ExternalDagSensor(
    task_id='jms_ods__yl_tmsnew_tms_shipment',
    external_dag_id='jms_ods_tms_day',
    external_task_id='jms_ods__yl_tmsnew_tms_shipment',
    external_execution_date_time='{{ execution_date | cst_ds }} 02:50:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)

jms_ods__yl_tmsnew_tms_vehicle_point = ExternalDagSensor(
    task_id='jms_ods__yl_tmsnew_tms_vehicle_point',
    external_dag_id='jms_ods_tms_day',
    external_task_id='jms_ods__yl_tmsnew_tms_vehicle_point',
    external_execution_date_time='{{ execution_date | cst_ds }} 02:50:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)

jms_ods__yl_tmsnew_tms_vehicle_line = ExternalDagSensor(
    task_id='jms_ods__yl_tmsnew_tms_vehicle_line',
    external_dag_id='jms_ods_tms_day',
    external_task_id='jms_ods__yl_tmsnew_tms_vehicle_line',
    external_execution_date_time='{{ execution_date | cst_ds }} 02:50:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)

jms_ods__tab_barscan_centersend = ExternalDagSensor(
    task_id='jms_ods__tab_barscan_centersend',
    external_dag_id='jms_ods_tab_day',
    external_task_id='jms_ods__tab_barscan_centersend',
    external_execution_date_time='{{ execution_date | cst_ds }} 02:50:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)

jms_ods__tab_barscan_unloading = ExternalDagSensor(
    task_id='jms_ods__tab_barscan_unloading',
    external_dag_id='jms_ods_tab_day',
    external_task_id='jms_ods__tab_barscan_unloading',
    external_execution_date_time='{{ execution_date | cst_ds }} 02:50:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)


jms_ods__tab_reback_transfer_express = ExternalDagSensor(
    task_id='jms_ods__tab_reback_transfer_express',
    external_dag_id='jms_ods_tab_day',
    external_task_id='jms_ods__tab_reback_transfer_express',
    external_execution_date_time='{{ execution_date | cst_ds }} 02:50:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)

jms_ods__tab_barscan_centerarrival = ExternalDagSensor(
    task_id='jms_ods__tab_barscan_centerarrival',
    external_dag_id='jms_ods_tab_day',
    external_task_id='jms_ods__tab_barscan_centerarrival',
    external_execution_date_time='{{ execution_date | cst_ds }} 02:50:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)

jms_ods__tab_barscan_loading = ExternalDagSensor(
    task_id='jms_ods__tab_barscan_loading',
    external_dag_id='jms_ods_tab_day',
    external_task_id='jms_ods__tab_barscan_loading',
    external_execution_date_time='{{ execution_date | cst_ds }} 02:50:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)

jms_ods__tab_barscan_other = ExternalDagSensor(
    task_id='jms_ods__tab_barscan_other',
    external_dag_id='jms_ods_tab_day',
    external_task_id='jms_ods__tab_barscan_other',
    external_execution_date_time='{{ execution_date | cst_ds }} 02:50:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)
jms_ods__yl_oms_interceptorpiece = ExternalDagSensor(
    task_id='jms_ods__yl_oms_interceptorpiece',
    external_dag_id='jms_ods_oms_day',
    external_task_id='jms_ods__yl_oms_interceptorpiece',
    external_execution_date_time='{{ execution_date | cst_ds }} 02:50:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)

jms_ods__electronic_package_list = ExternalDagSensor(
    task_id='jms_ods__electronic_package_list',
    external_dag_id='jms_ods_ide_day',
    external_task_id='jms_ods__electronic_package_list',
    external_execution_date_time='{{ execution_date | cst_ds }} 02:50:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)

jms_ods__tab_report_errorseparatedetail = DummyOperator(
    task_id='jms_ods__tab_report_errorseparatedetail',
    email=['rongguangfan@jtexpress.com','yl_bigdata@yl-scm.com'],
    retries=0,
    # sla=timedelta(hours=2),
)

jms_ods__ass_scan_small_upper = DummyOperator(
    task_id='jms_ods__ass_scan_small_upper',
    email=['rongguangfan@jtexpress.com','yl_bigdata@yl-scm.com'],
    retries=0,
    # sla=timedelta(hours=2),
)



jms_ods__yl_lmdm_sys_network_expand = DummyOperator(
    task_id='jms_ods__yl_lmdm_sys_network_expand',
    email=['rongguangfan@jtexpress.com','yl_bigdata@yl-scm.com'],
    retries=0,
    # sla=timedelta(hours=2),
)




jms_ods__tab_barscan_arrival = ExternalDagSensor(
    task_id='jms_ods__tab_barscan_arrival',
    external_dag_id='jms_ods_tab_day',
    external_task_id='jms_ods__tab_barscan_arrival',
    external_execution_date_time='{{ execution_date | cst_ds }} 02:50:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)

jms_ods__tab_barscan_send = ExternalDagSensor(
    task_id='jms_ods__tab_barscan_send',
    external_dag_id='jms_ods_tab_day',
    external_task_id='jms_ods__tab_barscan_send',
    external_execution_date_time='{{ execution_date | cst_ds }} 02:50:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)
jms_ods__tab_barscan_taking = ExternalDagSensor(
    task_id='jms_ods__tab_barscan_taking',
    external_dag_id='jms_ods_tab_day',
    external_task_id='jms_ods__tab_barscan_taking',
    external_execution_date_time='{{ execution_date | cst_ds }} 02:50:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)

jms_ods__tab_barscan_bagging = ExternalDagSensor(
    task_id='jms_ods__tab_barscan_bagging',
    external_dag_id='jms_ods_tab_day',
    external_task_id='jms_ods__tab_barscan_bagging',
    external_execution_date_time='{{ execution_date | cst_ds }} 02:50:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)

jms_ods__yl_oms_oms_waybill = ExternalDagSensor(
    task_id='jms_ods__yl_oms_oms_waybill',
    external_dag_id='jms_ods_oms_day',
    external_task_id='jms_ods__yl_oms_oms_waybill',
    external_execution_date_time='{{ execution_date | cst_ds }} 02:50:00',
    execution_delta_time_unit='days',
    execution_delta=0,
    allowed_states='success',
    mode='reschedule',
    timeout=600
)

